<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>sort()</title>
</head>

<body>
    <script>
        console.log([1, 99, 5, -5, 4, 8, 97, 54].sort((a, b) =>
            a - b //升序
            //b-a 降序
        ))
    </script>
</body>

</html>